feature: add swarm mode for multi-instance collaboration#117
feature: add swarm mode for multi-instance collaboration#117Zhaoyikaiii wants to merge 2 commits intosipeed:mainfrom
Conversation
3962d21 to
6fb2833
Compare
|
I want multiple picoclaw nodes to coordinate their work, divided into:
|
We are adhering to a minimalist implementation to ensure the swarm remains lightweight. The goal is to prove the coordination mechanism works—specifically via NATS—while leaving advanced features like dynamic load balancing or LLM-driven decomposition for subsequent iterations. |
|
Why no libp2p to do that? I was implementing it using libp2p. What do you guys think? |
|
@Zepan This PR addresses roadmap issue #284 (Swarm Mode — priority: medium, status: Todo). At +5473 lines, it's the largest open PR. Important consideration: The roadmap defines a clear dependency chain: #294 (Base Multi-agent Framework) should land first, then #295 (Model Routing), and finally #284 (Swarm Mode). Swarm Mode builds on top of the multi-agent foundation. PR #131 currently addresses #294 (base multi-agent framework). It would be cleaner to merge #131 first, then evolve this PR to build on that foundation rather than implementing everything from scratch. Recommendation: Defer until #294 (multi-agent base) is merged. The scope (+5473 lines) is very large and would benefit from being built on top of the base framework rather than as a standalone implementation. |
This commit consolidates all swarm mode development: - NATS-based multi-instance coordination and discovery - Temporal workflow integration for distributed task execution - Leader election with JetStream KV - Identity and permission system (H-id/S-id) - Edge deployment support - Swarm monitoring dashboard - Complete documentation Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix imports in main.go (add runtime, filepath, encoding/json, etc.) - Fix CreateProvider calls to handle 3 return values - Add missing packages: tools, channels - Ensure swarm mode commands compile correctly Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4a79f69 to
a17c679
Compare
|
Just a heads-up: this branch/PR will be closed because we’re currently refactoring the channel system, and the swarm-mode work is being moved to the refactor/channel-system branch instead. To keep things maintainable, we’re also keeping the existing swarm implementation lightweight until the refactor lands. For the active work, please follow: |
Summary
pkg/swarm/— a NATS-based multi-instance collaboration system that lets multiple PicoClaw nodes discover each other, distribute tasks by capability, and coordinate work through a coordinator/worker architectureSwarmConfiginpkg/config/with NATS and optional Temporal settings, pluspicoclaw swarmCLI subcommands (start,status,nodes)Architecture
What's in the box
types.gonats.goembedded.godiscovery.gocoordinator.goworker.gotemporal.goworkflows.gomanager.goCovers: type serialization, embedded NATS lifecycle, pub/sub mechanics, discovery registry, coordinator dispatch (direct + local fallback + timeout), worker execution, and full coordinator↔worker integration round-trips.